<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>Matrix (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>

  <script type="text/javascript" src="//www.google.com/jsapi"></script>
  <script type="text/javascript">
     google.load("visualization", "1", {packages:["orgchart"]});
     var _loadingVisualizations = true;
  </script>

  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">math.Matrix</span>
        <span>Extends</span>
        <span class="fn-name">
          
        </span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Class for representing and manipulating matrices.

The entry that lies in the i-th row and the j-th column of a matrix is
typically referred to as the i,j entry of the matrix.

The m-by-n matrix A would have its entries referred to as:
  [ a0,0   a0,1   a0,2   ...   a0,j  ...  a0,n ]
  [ a1,0   a1,1   a1,2   ...   a1,j  ...  a1,n ]
  [ a2,0   a2,1   a2,2   ...   a2,j  ...  a2,n ]
  [  .      .      .            .          .   ]
  [  .      .      .            .          .   ]
  [  .      .      .            .          .   ]
  [ ai,0   ai,1   ai,2   ...   ai,j  ...  ai,n ]
  [  .      .      .            .          .   ]
  [  .      .      .            .          .   ]
  [  .      .      .            .          .   ]
  [ am,0   am,1   am,2   ...   am,j  ...  am,n ]


  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_math_matrix.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/math/matrix.js">Git</a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
  <tr><td>goog.math.Matrix</td><td></td></tr>
</table>
</div>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
</table>
</div>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.math.Matrix(<span><span class="arg">m</span>,&nbsp;<span class="arg">opt_n</span></span>)
  </div>

   <h3>Parameters</h3>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">m</span>
        : <span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;&gt;<span>&nbsp;|&nbsp;</span><span class="type"><a href="class_goog_math_Size.html">goog.math.Size</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">A matrix to copy, a 2D-array to take as a template, a size object for
    dimensions, or the number of rows.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_n</span>
        : <span class="type">number=</span>
        <div class="entryOverview">Number of columns of the matrix (only applicable if
    the first argument is also numeric).</div>
     </td>
   </tr>
  </table>


<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_math_Matrix.html">
              goog.math.Matrix
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.add"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">add<span class="args">(<span class="arg">m</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Returns a new matrix that is the sum of this and the provided matrix.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">m</span>
        : <span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
        <div class="entryOverview">The matrix to add to this one.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            Resultant sum.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line200">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.appendColumns"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">appendColumns<span class="args">(<span class="arg">m</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Appends the given matrix to the right side of this matrix.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">m</span>
        : <span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
        <div class="entryOverview">The matrix to augment this matrix with.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            A new matrix with additional columns on the
    right.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line216">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.appendRows"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">appendRows<span class="args">(<span class="arg">m</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Appends the given matrix to the bottom of this matrix.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">m</span>
        : <span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
        <div class="entryOverview">The matrix to augment this matrix with.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            A new matrix with added columns on the bottom.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line238">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.equals"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">equals<span class="args">(<span class="arg">m</span>,&nbsp;<span class="arg">opt_tolerance</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Returns whether the given matrix equals this matrix.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">m</span>
        : <span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
        <div class="entryOverview">The matrix to compare to this one.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_tolerance</span>
        : <span class="type">number=</span>
        <div class="entryOverview">The tolerance when comparing array entries.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the given matrix equals this matrix.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line261">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.getCofactor_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getCofactor_<span class="args">(<span class="arg">i</span>,&nbsp;<span class="arg">j</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the signed minor.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">i</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The row index.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">j</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The column index.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The cofactor C[i,j] of this matrix.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line537">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.getDeterminant"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getDeterminant<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the determinant of this matrix.  The determinant of a matrix A is
often denoted as |A| and can only be applied to a square matrix.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The determinant of this matrix.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line288">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.getDeterminant_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getDeterminant_<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the determinant of this matrix.  The determinant of a matrix A is
often denoted as |A| and can only be applied to a square matrix.  Same as
public method but without validation.  Implemented using Laplace's formula.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The determinant of this matrix.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line549">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.getInverse"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getInverse<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Returns the inverse of this matrix if it exists or null if the matrix is
not invertible.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            A new matrix which is the inverse of this matrix.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line302">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.getMinor_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getMinor_<span class="args">(<span class="arg">i</span>,&nbsp;<span class="arg">j</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the determinant of the submatrix resulting from the deletion of row i
and column j.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">i</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The row to delete.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">j</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The column to delete.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The first minor M[i,j] of this matrix.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line572">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.getReducedRowEchelonForm"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getReducedRowEchelonForm<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Transforms this matrix into reduced row echelon form.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            A new matrix reduced row echelon form.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line325">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.getSize"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getSize<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Size.html">goog.math.Size</a></span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Size.html">goog.math.Size</a></span>&nbsp;
            The dimensions of the matrix.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line375">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.getSubmatrixByCoordinates_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getSubmatrixByCoordinates_<span class="args">(<span class="arg">i1</span>,&nbsp;<span class="arg">j1</span>,&nbsp;<span class="arg">opt_i2</span>,&nbsp;<span class="arg">opt_j2</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Returns a submatrix contained within this matrix.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">i1</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The upper row index.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">j1</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The left column index.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_i2</span>
        : <span class="type">number=</span>
        <div class="entryOverview">The lower row index.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_j2</span>
        : <span class="type">number=</span>
        <div class="entryOverview">The right column index.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            The submatrix contained within the given bounds.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line586">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.getSubmatrixByDeletion_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getSubmatrixByDeletion_<span class="args">(<span class="arg">i</span>,&nbsp;<span class="arg">j</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Returns a new matrix equal to this one, but with row i and column j deleted.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">i</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The row index of the coordinate.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">j</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The column index of the coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            The value at the specified coordinate.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line605">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.getTranspose"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getTranspose<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Return the transpose of this matrix.  For an m-by-n matrix, the transpose
is the n-by-m matrix which results from turning rows into columns and columns
into rows

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            A new matrix A^T.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line386">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.getValueAt"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getValueAt<span class="args">(<span class="arg">i</span>,&nbsp;<span class="arg">j</span>)</span>
        </span>
        &#8658; <span>?</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Retrieves the value of a particular coordinate in the matrix or null if the
requested coordinates are out of range.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">i</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The i index of the coordinate.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">j</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The j index of the coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>?</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The value at the specified coordinate.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line402">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.isInBounds_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">isInBounds_<span class="args">(<span class="arg">i</span>,&nbsp;<span class="arg">j</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Returns whether the given coordinates are contained within the bounds of the
matrix.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">i</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The i index of the coordinate.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">j</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The j index of the coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            The value at the specified coordinate.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line622">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.isSquare"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">isSquare<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the horizontal and vertical dimensions of this
    matrix are the same.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line414">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.matrixMultiply_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">matrixMultiply_<span class="args">(<span class="arg">m</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Matrix multiplication is defined between two matrices only if the number of
columns of the first matrix is the same as the number of rows of the second
matrix. If A is an m-by-n matrix and B is an n-by-p matrix, then their
product AB is an m-by-p matrix


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">m</span>
        : <span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
        <div class="entryOverview">Matrix to multiply the matrix by.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            Resultant product.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line638">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.multiply"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">multiply<span class="args">(<span class="arg">m</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Performs matrix or scalar multiplication on a matrix and returns the
resultant matrix.

Matrix multiplication is defined between two matrices only if the number of
columns of the first matrix is the same as the number of rows of the second
matrix. If A is an m-by-n matrix and B is an n-by-p matrix, then their
product AB is an m-by-p matrix

Scalar multiplication returns a matrix of the same size as the original,
each value multiplied by the given value.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">m</span>
        : <span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Matrix/number to multiply the matrix by.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            Resultant product.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line451">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.scalarMultiply_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">scalarMultiply_<span class="args">(<span class="arg">m</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Scalar multiplication returns a matrix of the same size as the original,
each value multiplied by the given value.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">m</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">number to multiply the matrix by.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            Resultant product.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line659">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.setValueAt"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">setValueAt<span class="args">(<span class="arg">i</span>,&nbsp;<span class="arg">j</span>,&nbsp;<span class="arg">value</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets the value at a particular coordinate (if the coordinate is within the
bounds of the matrix).

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">i</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The i index of the coordinate.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">j</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The j index of the coordinate.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">value</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The new value for the coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line426">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.subtract"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">subtract<span class="args">(<span class="arg">m</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Returns a new matrix that is the difference of this and the provided matrix.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">m</span>
        : <span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
        <div class="entryOverview">The matrix to subtract from this one.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            Resultant difference.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line472">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.swapRows_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">swapRows_<span class="args">(<span class="arg">i1</span>,&nbsp;<span class="arg">i2</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Swaps two rows.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">i1</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The index of the first row to swap.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">i2</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The index of the second row to swap.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line672">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.toArray"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">toArray<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;&gt;
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;&gt;&nbsp;
            A 2D internal array representing this
    matrix.  Not a clone.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line487">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.prototype.toString"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">toString<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Returns a string representation of the matrix.  e.g.
<pre class="lang-js prettyprint">
[ 12  5  9  1 ]
[  4 16  0 17 ]
[ 12  5  1 23 ]
</pre>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            A string representation of this matrix.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line504">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Instance Properties</h2>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_math_Matrix.html">
              goog.math.Matrix
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.math.Matrix.prototype.array_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">array_</span>
        : 
     </div>


     <div class="entryOverview">
       Internal array representing the matrix.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line184">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.math.Matrix.prototype.size_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">size_</span>
        : <span class="type"><a href="class_goog_math_Size.html">goog.math.Size</a></span>
     </div>


     <div class="entryOverview">
       After construction the Matrix's size is constant and stored in this object.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line192">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Static Methods</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.createIdentityMatrix"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Matrix.</span><span class="entryName">createIdentityMatrix<span class="args">(<span class="arg">n</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Creates a square identity matrix. i.e. for n = 3:
<pre class="lang-js prettyprint">
[ 1 0 0 ]
[ 0 1 0 ]
[ 0 0 1 ]
</pre>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">n</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The size of the square identity matrix.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            Identity matrix of width and height <code> n</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line84">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.createZeroPaddedArray_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Matrix.</span><span class="entryName">createZeroPaddedArray_<span class="args">(<span class="arg">m</span>,&nbsp;<span class="arg">n</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;&gt;
      </div>


     <div class="entryOverview">
       Creates a new zero padded matix.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">m</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Height of matrix.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">n</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Width of matrix.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;&gt;&nbsp;
            The new zero padded matrix.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line167">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.forEach"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Matrix.</span><span class="entryName">forEach<span class="args">(<span class="arg">matrix</span>,&nbsp;<span class="arg">fn</span>,&nbsp;<span class="arg">opt_obj</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Calls a function for each cell in a matrix.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">matrix</span>
        : <span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
        <div class="entryOverview">The matrix to iterate over.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">fn</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The function to call for every element. This function
    takes 4 arguments (value, i, j, and the matrix)
    and the return value is irrelevant.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_obj</span>
        : <span class="type">Object=</span>
        <div class="entryOverview">The object to be used as the value of 'this'
    within <code> fn</code>.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line105">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.isValidArray"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Matrix.</span><span class="entryName">isValidArray<span class="args">(<span class="arg">arr</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Tests whether an array is a valid matrix.  A valid array is an array of
arrays where all arrays are of the same length and all elements are numbers.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">arr</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>
        <div class="entryOverview">An array to test.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the array is a valid matrix.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line120">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Matrix.map"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Matrix.</span><span class="entryName">map<span class="args">(<span class="arg">matrix</span>,&nbsp;<span class="arg">fn</span>,&nbsp;<span class="arg">opt_obj</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
      </div>


     <div class="entryOverview">
       Calls a function for every cell in a matrix and inserts the result into a
new matrix of equal dimensions.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">matrix</span>
        : <span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>
        <div class="entryOverview">The matrix to iterate over.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">fn</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The function to call for every element. This function
                    takes 4 arguments (value, i, j and the matrix)
                    and should return something. The result will be inserted
                    into a new matrix.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_obj</span>
        : <span class="type">Object=</span>
        <div class="entryOverview">The object to be used as the value of 'this'
    within <code> fn</code>.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span>&nbsp;
            A new matrix with the results from <code> fn</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix.js.source.html#line151">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package math</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="math.Matrix"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
